$(function() {
	admin.userMoneyLog.init();
});
Namespace('admin.userMoneyLog', {
	init : function() {
		easyui.util.initDatagrid('#datagrid', {
			onDblClickRow : function() {
			}
		});
	},
	query : function() {
		if (!$('#query-form').form('validate'))
			return;
		var data = $('#query-form').form('jsonObject');
		$('#datagrid').datagrid('load', data);
	},
	export2Excel : function() {//导出excel
		var url = contextPath + '/user/money/log/export2Excel';
		var type = $('#type').val();
		var userNick = $('#userNick').val();
		var searchETimeStr = $("input[name=searchETimeStr]").val();
		var searchBTimeStr = $("input[name=searchBTimeStr]").val();
		var params ={};
		var paramstr ="";
		if(type!='' && type!=null){
			paramstr+="&type="+type;
		}
		if(userNick!='' && userNick!=null){
			paramstr+="&userNick="+userNick;
		}
		if(searchBTimeStr!='' && searchBTimeStr!=null){
			paramstr+="&searchBTimeStr="+searchBTimeStr;
		}
		if(searchETimeStr!='' && searchETimeStr!=null){
			paramstr+="&searchETimeStr="+searchETimeStr;
		}
		if(paramstr!=''){
			url += "?"+paramstr;
		}
		window.open(url,"");
	},
	export2Excel4User : function() {//导出excel
		var url = contextPath + '/user/money/log/export2Excel4User';
		var userId = $('#userId').val();
		var type = $('#type').val();
		var searchETimeStr = $("input[name=searchETimeStr]").val();
		var searchBTimeStr = $("input[name=searchBTimeStr]").val();
		var params ={};
		var paramstr ="";
		if(userId!='' && userId!=null){
			paramstr+="&userId="+userId;
		}
		if(type!='' && type!=null){
			paramstr+="&type="+type;
		}
		if(searchBTimeStr!='' && searchBTimeStr!=null){
			paramstr+="&searchBTimeStr="+searchBTimeStr;
		}
		if(searchETimeStr!='' && searchETimeStr!=null){
			paramstr+="&searchETimeStr="+searchETimeStr;
		}
		if(paramstr!=''){
			url += "?"+paramstr;
		}
		window.open(url,"");
	}
});